package refect;

/**
 * @author xiaoming
 * @version 1.0
 * @date 2019-10-31 23:20
 **/
public class Test {
    public static void main(String[] args) {
        MyList myList = new MyList();
        myList.add("A");
        myList.add(11);

        System.out.println(myList.get(0));
        System.out.println((String)myList.get(1));

    }
}

class MyList {
    private Object[] objects = new Object[10];
    private int size;

    public void add(Object item) {
        objects[size++] = item;
    }

    public Object get(int index) {
        return objects[index];
    }

}